package process;

import java.util.Vector;
import databaseAcces.*;
public class Company {
	public boolean saveCVCompany(Vector<String> parametre_Company)
	{
		boolean resul = true;
		// Appeller  la classe InsertionRequest pour stocker les données 
		InsertionRequest req = new InsertionRequest();	
				
		// *******************************************************//
		// *			LA TABLE ENTREPRISE						 *//
		// *******************************************************//
		
		//parametre_En [0]: "num_En"		   				
		//parametre_En [1]: "nom_En"
		//parametre_En [2]: "web_site"
		//parametre_En [3]: "adresse"
		//parametre_En [4]: "telephone"
		//parametre_En [5]: "courriel"	   					
		//parametre_En [6]: "description"
		//parametre_En [7]: "num_user" ; deja active dessous
		
		
		String nom_En = parametre_Company.elementAt(0);
		String web_site = parametre_Company.elementAt(1);
		String adresse  = parametre_Company.elementAt(2);
		String telephone = parametre_Company.elementAt(3);
		String courriel = parametre_Company.elementAt(4);
		String description = parametre_Company.elementAt(5);			
		int num_user = Integer.parseInt(parametre_Company.elementAt(6));	
		
		
		
		// ====== Sauvegarder un nouveau candidat à la table entreprise ======//		
		resul = req.insertEntreprise(nom_En, web_site, adresse, telephone, courriel, description, num_user);		
		
		return resul;
				
	}
	public boolean UpdateCVCompany(int num_En, Vector<String> parametre_Company)
	{
		boolean resul = true;
		String nom_En = parametre_Company.elementAt(0);
		String web_site = parametre_Company.elementAt(1);
		String adresse  = parametre_Company.elementAt(2);
		String telephone = parametre_Company.elementAt(3);
		String courriel = parametre_Company.elementAt(4);
		String description = parametre_Company.elementAt(5);	
		int num_user = Integer.parseInt(parametre_Company.elementAt(6));	
		
		// Appeller  la classe InsertionRequest pour stocker les données 
		InsertionRequest req = new InsertionRequest();	
		resul = req.UpdateEntreprise(num_En, nom_En, web_site, adresse, telephone, courriel, description, num_user) ;
		
		return resul;
	}
}
